#必须使用deque，使用Queue会超时
from collections import deque

distance = [0 for i in range(0,2000000)]
visit = [0 for i in range(0,2000000)]
clients_now = [0 for i in range(0,2000000)]
real_clients_len = 0

n, m, k, d = map(int,input().split())

queue = deque()
for i in range(0,m):
    x,y = map(int,input().split())
    queue.append((x,y))
    key=1000*x+y
    distance[key] = 0
    visit[key] = 1

clients = []
for i in range(0,k):
    x,y,c = map(int,input().split())
    clients.append((x,y,c))
    key=1000*x+y
    if clients_now[key] == 0:
        real_clients_len+=1
    clients_now[key] += c

for i in range(0,d):
    x,y = map(int,input().split())
    key=1000*x+y
    visit[key] = 1

turn = [(1,0),(-1,0),(0,1),(0,-1)]
result = 0

if real_clients_len==0:
    print(result)
    exit(0)

while len(queue)>0:
    now = queue.popleft()
    x = now[0]
    y = now[1]

    for p in range(0,4):
        i = x + turn[p][0]
        j = y + turn[p][1]
        key=i*1000+j

        if i < 1 or j < 1 or i > n or j > n or visit[key] == 1:
            continue
        visit[key] = 1
        distance[key] = distance[x*1000+y] + 1
        queue.append((i,j))
        result+=(clients_now[key]*distance[key])
        if clients_now[key]>0:
            real_clients_len-=1
            if real_clients_len==0:
                print(result)
                exit(0)



